package com.teemo.dp.singleton.demo8;

import java.io.Serializable;

/**
 * @author Teemo
 */
public class Washer implements Serializable {
    private Washer() {
        System.out.println("Washer is created");
    }

    private static final Washer washer = new Washer();

    public static Washer getInstance() {
        return washer;
    }
    public void wash() {
        System.out.println("washing...");
    }

    private Object readResolve() {
        return washer;
    }

}
